// src/stores/attractions.ts
import { defineStore } from 'pinia'

interface Attraction {
  id: number
  name: string
  category: string
  rating: number
  reviews: number
  image: string
  description: string
}

export const useAttractionsStore = defineStore('attractions', {
  state: () => ({
    attractions: [] as Attraction[],
    recommended: [] as Attraction[]
  }),
  actions: {
    async fetchAttractions() {
      // 模拟异步数据获取
      this.attractions = [
        {
          id: 1,
          name: '法门寺',
          category: '文化古迹',
          rating: 4.7,
          reviews: 128,
          image: '/images/famen-temple.jpg',
          description: '唐代皇家寺院，佛教文化圣地'
        },
        // 添加更多景点数据...
      ]
    },
    getAttractionById(id: number) {
      return this.attractions.find(a => a.id === id)
    }
  }
})